<template>
    <view>
        <cu-custom bgColor="bg-gradual-green" :isBack="true">
            <block slot="backText"></block>
            <block slot="content">我的粉丝</block>
        </cu-custom>

        <view class="cu-card dynamic">
            <view class="cu-item shadow" v-for="(item,index) in list" :key="index">
                <view class="cu-list menu-avatar">
                    <view class="cu-item">
                        <view @click="toNav('/pages/info/index?user_id='+item.id)" class="cu-avatar round lg" :style="{'background-image':'url('+ item.avatar +')'}"></view>
                        <view class="content flex-sub">
                            <view>{{ item.nickname }}</view>
                            <!-- <view class="text-gray text-sm flex justify-between">
            					粉丝数量：29
            				</view> -->
                        </view>
                    </view>
                </view>
            </view>
        </view>

    </view>
</template>

<script>
    export default {
        data() {
            return {
                list: []
            }
        },
        onShow() {
            this.getFansList();
        },
        onHide() {
            console.log("hehe")
        },
        onLoad() {
            console.log("haha")
        },
        methods: {
            getFansList() {
                uni.showLoading({
                    title: '加载中...'
                })
                this.$http.post('getFansList', {
                    limit: 1000
                }).then(res => {
                    this.list = res.data.data;
                    uni.hideLoading()
                    console.log(res)
                }).catch(err => {
                    uni.hideLoading()
                    console.log(err)
                })
            },
            toNav(link) {
                uni.navigateTo({
                    url: link
                })
            }
        }
    }
</script>

<style lang="less" scoped>

</style>
